#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 crane <crane@gosun>
#
# Distributed under terms of the MIT license.

"""

"""

def coefficient_and_sum(i, n):
    power = [i**p for p in range(1, n+1)]
    power.append( sum([e**(n-1) for e in range(1, i+1)]) )

    return tuple(power)

def get_express(n):
    l = []
    for i in range(0, n):
        l.append("%s" + chr(ord('a') + i) )
    return " + ".join(l) + " = %s"

def get_express_mat(n):
    l = []
    for i in range(0, n):
        # l.append("%s" + chr(ord('a') + i) )
        l.append("%s" )
    return "" +  " , ".join(l) + ";" + " = %s"

def print_coffcient_equation(n):
    # 平方和2, 推出立方结果3
    power = n+1

    # express = get_express(power)
    express = get_express_mat(power)
    for i in range(1, power+1):
        print(express % coefficient_and_sum(i, power))


def main():
    print("start main")
    print_coffcient_equation(8)     # 平方和
    # print_coffcient_equation(10)     # 平方和
    # print_coffcient_equation(3)     # 立方和
    # print_coffcient_equation(4)
    # print_coffcient_equation(5)

if __name__ == "__main__":
    main()
